package com.controller;

import com.utils.aliyun.OssUtil;
import com.vo.ResponseVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

//设置跨域
@RestController
@RequestMapping("/api")
public class FileController {

    @PostMapping("/file/upload")
    public ResponseVO upload(MultipartFile file){

        String filePath = OssUtil.uploadDocument(file,"images");
        return new ResponseVO("200","上传成功",filePath);
    }
}
